<!--
 * @Descripttion: 
 * @version: 1.0
 * @Author: LiYansheng
 * @Date: 2022-05-08 14:49:19
 * @LastEditors: CoderXZ
 * @LastEditTime: 2022-05-08 14:51:14
-->
<template>
  <div>
    <div>
      <div :id="myData.id" :style="myData.style"></div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["myData"],
  mounted() {
    var chartDom = document.getElementById(this.myData.id);
    var myChart = this.$echarts.init(chartDom);
    var option;

    option = {
      title: {
        text: this.myData.title,
        subtext: "单位:元",
        left: "center",
      },
      xAxis: {
        type: "category",
        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      },
      yAxis: {
        type: "value",
      },
      series: [
        {
          data: [120, 200, 150, 80, 70, 110, 130],
          type: "bar",
        },
      ],
    };
    myChart.setOption(option);
  },
};
</script>

<style></style>
